package com.leetcode.LC;

public class LC1185 {
    public String dayOfTheWeek(int day, int month, int year) {
        if (month == 1 || month == 2) {
            month += 12;
            year--;
        }
        int iWeek = (day + 2 * month + 3 * (month + 1) / 5 + year + year / 4 - year / 100 + year / 400) % 7;                              //基姆拉尔森计算公式
        String result[] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
        return result[iWeek];

        /*作者：lumping
        链接：https://leetcode-cn.com/problems/day-of-the-week/solution/yong-mo-fa-dui-kang-mo-fa-by-lumping/
        来源：力扣（LeetCode）
        著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。*/
    }

    public static void main(String[] args) {
        System.out.println(new LC1185().dayOfTheWeek(12, 02, 2021));
    }
}
